<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>箭头函数</title>
</head>
<body>
    <!-- 点击后变红 -->
    <!-- <script>
        window.onload =()=>{
            var oBn = document.getElementById("box");
            oBn.onclick = ()=>{
                oBn.style.background="red"
            }
        }
    </script>
    <div id="box" style="background:peru;width: 50px;text-align: center">123</div> -->

    <script>
        var a = 101;
        var json={
            a:1,
            b:2,
            show:()=>{
                alert(this.a);
            }
        }
        json.show();
    </script>
</body>
</html>